//
//  UILable+Extention.swift
//  SinaBlog
//
//  Created by macs on 15/11/13.
//  Copyright © 2015年 BlackTail. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title : String , size : CGFloat? ,color : UIColor ,margin : CGFloat = 0){
        self.init()
        textAlignment = NSTextAlignment.Center
        font = UIFont.systemFontOfSize(size ?? 17)
        text = title
        textColor = color
        if margin != 0 {
            
            preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = .Left
        }
        
        numberOfLines = 0
        
    }
    
}
